let that;
import { getComboList } from "@/static/js/pointsMall.js";
export default {
  data() {
    return {
      showGz: false,
      topUpList: [],
      activeIndex: 0,
      payNum: "",
      maxNum: 10000, //最大
      minNum: 1, //最小
      payList: [
        {
          name: "微信",
          id: 2,
          icon: "iconzhifuye_weixinzhifu",
          iconColor: "#1fbe2a",
        },
        {
          name: "支付宝",
          id: 1,
          icon: "iconzhifubaozhifu",
          iconColor: "#01a9f2",
        },
      ],
      payCurrent: 2,
      ID: "",
      platform: "",
      productIds: [],
    };
  },
  onLoad(e) {
    that = this;
    this.getDataList();
    this.platform = uni.getSystemInfoSync().platform
  },
  methods: {
    // 获取数据
    async getDataList() {
      let { data, msg, code } = await getComboList();
      if (code == 1) {
        this.topUpList = data;
        this.clickMenu(this.topUpList[0], 0);
      } else {
        this.$tools.appBack(msg);
      }
    },
    //选择
    clickMenu(item, index) {
      this.activeIndex = index;
      this.payNum = item.amount;
      this.ID = item.id;
    },

    //切换支付方式
    changePay(item) {
      if (this.payCurrent != item.id) {
        this.payCurrent = item.id;
      }
    },

    payClick() {
      this.$tools.msg("暂未开放");
    }
  },
};